public class HF_ClientWSAccountRel{ 
    
    @future (callout=true)
     public static void AddRelationship(set<Id> relset) {
           string outputresult;
           List<Relationship__c> relList = new List<Relationship__c>([select Id,Contact__r.Name_Id__c,Related_Name_Id__c,Related_Partner_Id__c,Partner_Contact_ID__c,Relationship_Type_Code__c,Start_Date__c,StatusCode__c,End_Date__c,Description__c from Relationship__c where ID In: relset]); 
           WebServiceFinal4.BasicEndpoint s = new WebServiceFinal4.BasicEndpoint();
                for(Relationship__c rel: relList){
           //Insert Relation details in RelationshipWrapper
           WebServiceFinal2.RelationshipWrapper c=new WebServiceFinal2.RelationshipWrapper();
                c.SfdcRelationshipID= rel.Id;
                c.PartnerContactID=rel.Partner_Contact_ID__c;
                c.RelationshipType=rel.Relationship_Type_Code__c;
                c.StartDate=rel.Start_Date__c;
                c.EndDate=rel.End_Date__c;
                c.Comments=rel.Description__c;
                c.Status=rel.StatusCode__c;
                c.RelatedPartnerID=rel.Related_Partner_Id__c;
                c.RelatedNameID=Integer.Valueof(rel.Related_Name_Id__c);
                c.DataOn=system.DateTime.Now();
        try
        {
             outputresult=s.AddRelationship(c);
             system.debug('****'+outputresult);
        }
        catch(Exception ex)
        {
             system.debug('output from webservice: '+ex);       
        }
        }       
    }
     @future (callout=true)
          public static void UpdateRelationship(set<Id> relset) {
          string outputresult;
          List<Relationship__c> relList = new List<Relationship__c>([select Id,Related_Name_Id__c,Related_Partner_Id__c,Partner_Contact_ID__c,Relationship_Type_Code__c,Start_Date__c,StatusCode__c,End_Date__c,Description__c from Relationship__c where ID In: relset]); 
          WebServiceFinal4.BasicEndpoint s = new WebServiceFinal4.BasicEndpoint();
          for(Relationship__c rel: relList){
                //Update Relation details in RelationshipWrapper
                WebServiceFinal2.RelationshipWrapper c=new WebServiceFinal2.RelationshipWrapper();
                    c.SfdcRelationshipID=rel.Id;
                    c.PartnerContactID=rel.Related_Partner_Id__c;
                    c.RelationshipType=rel.Relationship_Type_Code__c;
                    c.StartDate=rel.Start_Date__c;
                    c.EndDate=rel.End_Date__c;
                    c.Comments=rel.Description__c;
                    c.Status=rel.StatusCode__c;
                    c.RelatedPartnerID=rel.Partner_Contact_ID__c;
                    c.RelatedNameID=Integer.Valueof(rel.Related_Name_Id__c);
                    c.DataOn=system.DateTime.Now();
        try
        {
             outputresult=s.UpdateRelationship(c);
             system.debug('****'+outputresult);
        }
        catch(Exception ex)
        {
          system.debug('output from webservice: '+ex);       
        }
        }       
    }
 }